<template>
	<view>
		<image class="imgtop" :src="img+infoData.src_img"></image>
		<view class="details">
			<text class="text">{{infoData.title}}</text>
			<p class="text2" v-html="infoData.describe"></p>
		</view>
		<view class="condition">
			<view>
				<text class="text">兑换条件</text>||<text class="text2">集齐{{name}}卡片</text><text class="text1" style="float: right;"
				 @click="showCard">查看全部</text>
			</view>

			<view>
				<text class="text3">备注：卡片下方有绿色标识的是自己已有的卡片</text>
			</view>

			<view class="card">
				<view v-for="(item,index) in list" :key="index" style="padding: 2rpx;">
					<image class="img" :src="item.url"></image>
					<image class="img2" :src="item.url2"></image>
				</view>
			</view>
			<view>
				<view class="buttn">
					<text class="tetx">立即兑换</text>
				</view>
			</view>
		</view>


		<view class="condition">
			<text class="text">盲盒规则</text>
			<p>一、盒子上面没有产品标注，只有打开盒子才会知道是什么礼品。你打开它，有可能是充电宝、耳机、游戏机、平板、手机...</p>
		</view>
		<image class="imgmiddle" src="../../static/img/details.png"></image>
		<text class="text">更多奖品</text>
		<view style="display: flex;justify-content: space-between;align-items: center;">
			<view class="bottom" v-for="(item,index) in listbottom" :key="index">
				<image class="img" src="../../static/img/detailstop.png"></image>
				<view style="margin-top: -60rpx;">
					<view>
						奔驰C200L运动版
					</view>
					<text>￥30.00w</text>
					<view class="buttn">
						<text class="tetx">兑换</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					url: '../../static/img/detailstop.png',
					url2: '../../static/img/check.png'
				}, {
					url: '../../static/img/detailstop.png',
					url2: ''
				}, {
					url: '../../static/img/detailstop.png',
					url2: '../../static/img/check.png'
				}, {
					url: '../../static/img/detailstop.png',
					url2: '../../static/img/check.png'
				}, {
					url: '../../static/img/detailstop.png',
					url2: '../../static/img/check.png'
				}],
				listbottom: [{
					url: '../../static/img/detailstop.png',
					url2: '../../static/img/check.png'
				}, {
					url: '../../static/img/detailstop.png',
					url2: ''
				}],
				infoData: {},
				img: getApp().globalData.imgbaseUrl,
				id: '',
				name: ''
			}
		},
		onLoad(options) {
			this.id = options.id;
			this.name = options.name;
			this.$api.getExchangeDetail(options.id).then(res => {
				this.infoData = res.data;
			})
		},
		methods: {
			showCard() {
				uni.navigateTo({
					url: './card?id=' + this.id + '&name=' + this.name
				})
			}
		}
	}
</script>

<style lang="scss">
	.imgtop {
		height: 495rpx;
		width: 750rpx;
	}

	.details {
		// width: 705rpx;
		border: 1px #000;
		border-radius: 0.5em;
		margin-left: 24rpx;
		margin-right: 24rpx;
		box-shadow: 0px 5px 9px #D3D3D3;
		padding: 22rpx;
		margin-top: 30rpx;

		.text {
			font-weight: 700;
			font-size: 26rpx;
		}

		.text2 {
			font-size: 22rpx;
		}
	}

	.condition {
		height: 404rpx;
		width: 705rpx;
		border: 1px #000;
		border-radius: 0.5em;
		margin-left: auto;
		margin-right: auto;
		box-shadow: 0px 5px 9px #D3D3D3;
		padding: 22rpx;
		margin-top: 40rpx;

		.text {
			font-weight: 700;
			font-size: 30rpx;
			margin-left: 20rpx;
		}

		.text2 {
			font-size: 22rpx;
			font-weight: 300;
			margin-left: 20rpx;
		}

		.text3 {
			font-size: 10rpx;
			font-weight: 300;
			margin-left: 20rpx;
		}

		.card {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 24rpx;

			.img {
				height: 139rpx;
				width: 112rpx;
			}

			.img2 {
				height: 33rpx;
				width: 33rpx;
				margin-left: 40rpx;
			}
		}

		.buttn {
			height: 48rpx;
			width: 285rpx;
			background-color: #07D0D2;
			border-radius: 1em;
			margin: 20rpx 5rpx;
			margin-left: auto;
			margin-right: auto;

			.tetx {
				height: 23px;
				width: 97rpx;
				color: #FFFFFF;
				font-weight: 700;
				margin-left: 92rpx;
			}
		}

	}

	.rule {
		height: 474rpx;
		width: 705rpx;
		border: 1px #000;
		border-radius: 0.5em;
		margin-left: auto;
		margin-right: auto;
		box-shadow: 0px 5px 9px #D3D3D3;
		padding: 27rpx;
		margin-top: 40rpx;

		.text {
			font-weight: bold;
		}

	}

	p {
		text-indent: 50rpx;
		font-size: 22rpx;
	}

	.imgmiddle {
		height: 1446rpx;
		width: 750rpx;
	}

	.text {
		font-size: 26rpx;
		font-weight: bold;
		margin-left: 40rpx;
	}

	.bottom {
		height: 340rpx;
		width: 333rpx;
		border: 1px #000;
		border-radius: 0.5em;
		margin: 40rpx 0rpx;
		margin-left: auto;
		margin-right: auto;
		box-shadow: 0px 5px 9px #D3D3D3;

		.img {
			height: 300rpx;
			width: 333rpx;
		}

		.buttn {
			height: 38rpx;
			width: 98rpx;
			background-color: #07D0D2;
			border-radius: 1em;
			margin: -40rpx 200rpx;

			.tetx {
				height: 23px;
				width: 97rpx;
				color: #FFFFFF;
				margin-left: 20rpx;
			}
		}
	}
</style>
